package br.com.wagnerpaz.battlemaniacs.model.action;

import java.util.LinkedList;
import java.util.List;

import br.com.wagnerpaz.battlemaniacs.model.Attribute;
import br.com.wagnerpaz.battlemaniacs.model.Fighter;

public class ActionLog
{
	private List<LogItem> logList;
	
	public ActionLog()
	{
		logList = new LinkedList<LogItem>();
	}
	
	public void logStatusChange(Fighter f, Attribute att, int valor)
	{
		logList.add( new LogItem(f, att, valor) );
	}

	public List<LogItem> getLogList()
	{
		return logList;
	}
	
	@Override
	public String toString()
	{
		String returnStr = "";
		
		for(LogItem item : logList)
		{
			returnStr += item.toString();
		}
		
		return returnStr;
	}
}

class LogItem
{
	private Fighter f;
	private Attribute att;
	private int value;
	
	public LogItem(Fighter f, Attribute att, int value)
	{
		this.f     = f;
		this.att   = att;
		this.value = value;
	}

	public Fighter getF()
	{
		return f;
	}

	public void setF(Fighter f)
	{
		this.f = f;
	}

	public Attribute getAtt()
	{
		return att;
	}

	public void setAtt(Attribute att)
	{
		this.att = att;
	}

	public int getValue()
	{
		return value;
	}

	public void setValue(int value)
	{
		this.value = value;
	}
	
	@Override
	public String toString()
	{
		return f.getName() + " -> " + att + ": " + value;
	}
}